🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / repository / src / commonMain / kotlin / org / meshtastic / core / repository / PlatformAnalytics.kt
Displaying Raw • Download
core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/PlatformAnalytics.kt 4f86b91973784e4ec05b9a5c7b2dc396ed4848b8 (4f86b919) Text, 4.06 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.repository
T8b949e/**
* Interface to abstract platform-specific functionalities, primarily for analytics and related services that differ
* between product flavors.
*/
Tff7b72interface T56d364PlatformAnalytics Tb4b4b4{
Tff7b72fun Td2a8fftrackTb4b4b4(Te6edf3eventTb4b4b4: Tffa657StringTb4b4b4, Tff7b72vararg Te6edf3propertiesTb4b4b4: Te6edf3DataPairTb4b4b4)
T8b949e/**
* Sets device-specific attributes (e.g., firmware version, hardware model) for analytics.
*
* @param firmwareVersion The firmware version of the connected device.
* @param model The hardware model of the connected device.
*/
Tff7b72fun Td2a8ffsetDeviceAttributesTb4b4b4(Te6edf3firmwareVersionTb4b4b4: Tffa657StringTb4b4b4, Te6edf3modelTb4b4b4: Tffa657StringTb4b4b4)
T8b949e/**
* Tracks a successful device connection as a custom RUM action, aligned with the Meshtastic-Apple DataDog
* integration for cross-platform analytics comparison.
*
* @param firmwareVersion The firmware version of the connected device (major.minor).
* @param transportType The transport used for the connection (e.g., "BLE", "TCP", "USB").
* @param hardwareModel The hardware model name of the connected device.
* @param nodes The total number of nodes in the mesh network.
* @param connectionRestored True if this connection was restored from device sleep rather than a fresh connect.
*/
Tff7b72fun Td2a8fftrackConnectTb4b4b4(
Te6edf3firmwareVersionTb4b4b4: Tffa657String?Tb4b4b4,
Te6edf3transportTypeTb4b4b4: Tffa657String?Tb4b4b4,
Te6edf3hardwareModelTb4b4b4: Tffa657String?Tb4b4b4,
Te6edf3nodesTb4b4b4: Tffa657IntTb4b4b4,
Te6edf3connectionRestoredTb4b4b4: Tffa657BooleanTb4b4b4,
Tb4b4b4) Tb4b4b4{
T8b949e// Default no-op for platforms that don't support RUM (fdroid, desktop)
Tb4b4b4}
T8b949e/**
* Tracks a key user interaction as a named custom RUM action. Auto-tracked tap targets are R8-obfuscated in release
* builds, so analytically important interactions must be reported explicitly with a stable name.
*
* @param name Stable snake_case action name (e.g. "message_send", "traceroute_request").
* @param attributes Optional structured attributes attached to the action.
*/
Tff7b72fun Td2a8fftrackActionTb4b4b4(Te6edf3nameTb4b4b4: Tffa657StringTb4b4b4, Te6edf3attributesTb4b4b4: Te6edf3MapTff7b72<Tffa657StringTb4b4b4, Tffa657AnyTff7b72> Tff7b72= Te6edf3emptyMapTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{
T8b949e// Default no-op for platforms that don't support RUM (fdroid, desktop)
Tb4b4b4}
T8b949e/**
* Starts tracking a screen as a RUM view, aligned with the Meshtastic-Apple Datadog integration (which auto-tracks
* SwiftUI views) so per-screen RUM data lines up across platforms.
*
* Starting a view implicitly stops any previously active view. Callers should pair each call with a matching
* [stopScreenView] using the same [key] when the screen is left.
*
* @param key A stable identifier that pairs this start with its matching [stopScreenView].
* @param name The route-derived view name (e.g. `org.meshtastic.core.navigation.NodesRoute.Nodes`).
*/
Tff7b72fun Td2a8ffstartScreenViewTb4b4b4(Te6edf3keyTb4b4b4: Tffa657StringTb4b4b4, Te6edf3nameTb4b4b4: Tffa657StringTb4b4b4) Tb4b4b4{
T8b949e// Default no-op for platforms that don't support RUM (fdroid, desktop)
Tb4b4b4}
T8b949e/**
* Stops the RUM view previously started with [startScreenView] for the given [key].
*
* @param key The same identifier passed to the matching [startScreenView].
*/
Tff7b72fun Td2a8ffstopScreenViewTb4b4b4(Te6edf3keyTb4b4b4: Tffa657StringTb4b4b4) Tb4b4b4{
T8b949e// Default no-op for platforms that don't support RUM (fdroid, desktop)
Tb4b4b4}
T8b949e/**
* Indicates whether platform-specific services (like Google Play Services or Datadog) are available and
* initialized.
*/
Tff7b72val Te6edf3isPlatformServicesAvailableTb4b4b4: Tffa657Boolean
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s